// const articleModel = require('./models/articleModel');
module.exports = function (success, error) {
    const mongoose = require('mongoose')
    const { HOST, PORT, NAME } = require('./config')
    mongoose.set('strictQuery', true)
    mongoose.connect(`mongodb://${HOST}:${PORT}/${NAME}`)

    mongoose.connection.once('open', () => {
        // articleModel.collection.createIndex(
        //     { keyWords: 1 },
       
        // );
        success();
    })

    mongoose.connection.on('error', () => {
        
        error()

    })


}